class Solution {
public:
    int trap(vector<int>& height) {
        int vleft[20010] = { 0 };
        int vright[20010] = { 0 };
        int maxn = 0;
        for (int i = 0; i < height.size(); i++) {
            maxn = max(height[i], maxn);
            vleft[i] = maxn;
        }
        maxn = 0;
        for (int i = height.size() - 1; i >= 0; i--) {
            maxn = max(height[i], maxn);
            vright[i] = maxn;
        }
        int ans = 0;
        for (int i = 0; i < height.size(); i++) {
            ans += (min(vleft[i], vright[i]) - height[i]);
        }
        return ans;
    }
};

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    cout << (a + b) << endl;
    return 0;
}

using namespace std;

int main()
{
    int ans = 0;
    int n, N;
    scanf("%d,%d", &n, &N);
    for (int i = n; i <= N; i++) {
        if (i % 2 == 0 && i % 3 == 0) {
            ans += i;
        }
    }
    cout << ans << endl;
    return 0;
}

using namespace std;

int main()
{
    vector<int> s(1000, 0);
    int digit_n;
    cin >> digit_n;
    int tmp;
    for (int i = 0; i < digit_n; i++) {
        scanf("%d", &tmp);
        s.push_back(tmp);
    }
    unordered_set<int> occ;
    int n = s.size();
    int rk = -1, ans = 0;
    for (int i = 0; i < n; ++i) {
        if (i != 0) {
            occ.erase(s[i - 1]);
        }
        while (rk + 1 < n && !occ.count(s[rk + 1])) {
            occ.insert(s[rk + 1]);
            ++rk;
        }
        ans = max(ans, rk - i + 1);
    }
    cout << ans << endl;
    return 0;
}

using namespace std;

int main()
{
    string s;
    cin >> s;
    char ans = s[0];
    for (char e : s) {
        if (ans < e) {
            ans = e;
        }
    }
    cout << ans << endl;
    return 0;
}

int main()
{
    int n;
    cin >> n;
    while (n--) {
        string s;
        cin >> s;
        int digit1 = 0, digit2 = 0;
        for (int i = 0; i < s.size(); i++) {
            if (i % 2 == 0) {
                if (s[i] == 'A')digit1++;
                if (s[i] == 'B')digit2++;
            }
            else {
                if (s[i] == 'B')digit1++;
                if (s[i] == 'A')digit2++;
            }
        }
        cout << min(digit1, digit2) << endl;
    }
    return 0;
}